package com.yonyou.hjw.plugin;

import com.yonyou.ypd.bill.annotation.BillPlugin;
import com.yonyou.ypd.bill.bizflow.service.api.IYpdBillBizFlowService;
import com.yonyou.ypd.bill.context.YpdBillContext;
import com.yonyou.ypd.bill.plugin.AbstractBillPlugin;
import org.springframework.beans.factory.annotation.Autowired;

@BillPlugin(busiObj = "hjw_saleorder", code = "hjw_saleorder")
public class HjwSaleOrderPlugin extends AbstractBillPlugin {

    @Autowired(required = false)
    private IYpdBillBizFlowService bizFlowService;

    @Override
    public void afterSave(YpdBillContext billContext) throws Exception {

        bizFlowService.writeBack(billContext.getBaseBillContext(),billContext.getBillDO());
    }

    @Override
    public void afterDelete(YpdBillContext billContext) throws Exception {
        bizFlowService.writeBack(billContext.getBaseBillContext(),billContext.getBillDO());
    }
}
